import React, { Component } from 'react';
import { Router, Route, Switch } from 'react-router-dom';
// import history from './history.js';

import App from '../App';
import Login from '../page/Login/Index';
import Home from '../components/Home';
import NoMatch from '../components/404';

var createBrowserHistory = require("history").createBrowserHistory;

export default class CRouter extends Component {
  render() {
    return (
      <Router history={new createBrowserHistory()}>
        <Switch>
          <Route exact path="/" component={Home}/>
          <Route path="/app" component={App}/>
          <Route path="/login" component={Login}/>
          <Route component={NoMatch}/>
        </Switch>
      </Router>
    )
  }

}